package cn.jetpiece.cloud.common.app.modular.message.service;

import cn.jetpiece.cloud.common.api.message.model.query.AnnouncementQuery;
import cn.jetpiece.cloud.common.api.message.model.result.AnnouncementMessageResult;
import cn.jetpiece.cloud.common.app.modular.message.entity.Announcement;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * 系统通告表
 *
 * @author jetpiece
 * @since 2022-11-16
 */
public interface IAnnouncementService extends IService<Announcement> {

    /**
     * 保存系统通告
     *
     * @param entity 系统通告
     * @return 结果
     */
    boolean saveAnnouncement(Announcement entity);

    /**
     * 更新系统通告
     *
     * @param entity 系统通告
     * @return 结果
     */
    boolean updateAnnouncement(Announcement entity);

    /**
     * 自定义分页查询，获取用户消息
     *
     * @param page         分页
     * @param query        查询条件
     * @param queryWrapper 查询条件
     * @return 结果
     */
    IPage<AnnouncementMessageResult> customSelectPage(Page<Announcement> page, AnnouncementQuery query, QueryWrapper<Announcement> queryWrapper);
}
